home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / WARNING.H < prev   
Text File  |  1988-06-11  |  2KB  |  79 lines

  1. /* -*-C-*- warning.h */
  2. /*-->warning*/
  3. /**********************************************************************/
  4. /****************************** warning *******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. warning(msg)                /* issue a warning */
  9. char *msg;                /* message string  */
  10. {
  11.  
  12. #if    (BBNBITGRAPH | VGASCREEN)
  13.     if (quiet)                /* no warnings in quiet mode */
  14.         return;
  15. #endif
  16.  
  17.     if (g_dolog && (g_logfp == (FILE *)NULL) && g_logname[0])
  18.     {
  19.     g_logfp = fopen(g_logname,"w+");
  20.     DEBUG_OPEN(g_logfp,g_logname,"w+");
  21.     if (g_logfp != (FILE *)NULL)
  22.     {
  23.         (void)fprintf(stderr,"[Log file [%s] created]",g_logname);
  24.         NEWLINE(stderr);
  25.  
  26. #if    OS_TOPS20
  27. #if    PCC_20
  28.         /* Because of the PCC-20 arithmetic (instead of */
  29.         /* logical) shift bug wherein a constant expression */
  30.         /* (1<<35) evaluates to 0 instead of 400000,,000000, */
  31.         /* we must set CF_nud using a variable, instead of */
  32.         /* just using a constant "ac1 = makefield(CF_nud,1);" */
  33.         ac1 = 1;
  34.         ac1 = makefield(CF_nud,ac1);
  35.         setfield(ac1,CF_jfn,jfnof(fileno(g_logfp)));    /* jfn */
  36.         setfield(ac1,CF_dsp,FBbyv);    /* generation number index in fdb */
  37.         ac2 = makefield(FB_ret,-1);
  38.         ac3 = makefield(FB_ret,0);/* set generation count to 0 (infinite) */
  39.         (void)jsys(JSchfdb,acs);    /* ignore any errors */
  40. #endif /* PCC_20 */
  41. #endif
  42.  
  43.     }
  44.     }
  45.  
  46.     if (g_dolog && (g_logfp != (FILE *)NULL) && g_logname[0])
  47.     {
  48.     NEWLINE(g_logfp);
  49.  
  50. #if    (OS_TOPS20 | OS_VAXVMS)
  51.     (void)putc('%',g_logfp);    /* percent at start of line */
  52. #endif
  53.  
  54.     (void)fputs(msg,g_logfp);
  55.     NEWLINE(g_logfp);
  56.     (void)fprintf(g_logfp,"Current TeX page counters: [%s]",tctos());
  57.     NEWLINE(g_logfp);
  58.     }
  59.  
  60.     if (g_dolog && (g_logfp == (FILE *)NULL) && g_logname[0])
  61.     {
  62.     (void)sprintf(message,"Cannot open log file [%s]",g_logname);
  63.     fatal(message);
  64.     }
  65.     NEWLINE(stderr);
  66.  
  67. #if    (OS_TOPS20 | OS_VAXVMS)
  68.     (void)putc('%',stderr);    /* percent at start of line */
  69. #endif
  70.  
  71.     (void)fputs(msg,stderr);
  72.     NEWLINE(stderr);
  73.     if (g_logname[0])
  74.     {
  75.     (void)fprintf(stderr,"Current TeX page counters: [%s]",tctos());
  76.     NEWLINE(stderr);
  77.     }
  78. }
  79.